package com.ynny08;

public class Student extends  Person {

    public int no;

    public double scoreEn;

    public double screMath;
    public double scoreCh;

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScreMath() {
        return screMath;
    }

    public void setScreMath(double screMath) {
        this.screMath = screMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }

//    public double aver;
//
//    public double max;
//
//    public double min;



    public double aver(){

        double c = (scoreCh+scoreEn+screMath)/3;
        return c;
    }

    public double max(){
        double m = Math.max(Math.max(scoreCh,scoreEn),screMath);
        return m;
    }

    public double min(){
        double y = Math.min(Math.min(scoreCh,scoreEn),screMath);
        return y;
    }

    @Override
    public String toString() {
        Student student = new Student();
        student.aver();
        student.max();
        student.min();
        return "Student{" +
                "学号=" + no +
                ", 英语成绩=" + scoreEn +
                ", 数学成绩=" + screMath +
                ", 语文成绩=" + scoreCh +
                ", 平均成绩=" + aver() +
                ", 最大值=" + max() +
                ", 最小值=" + min() +
                ", 名字='" + name + '\'' +
                ", 性别='" + sex + '\'' +
                ", 年纪=" + age +
                '}';
    }
}